#include "inc.h"

void *FunTakePhoto( void *arg )
{
    while(1)
    {
        printf("2. FunTakePhoto Running...tid = %ld\n", pthread_self() );
        sleep(1);
    }
}

void *FunSendPhoto( void *arg )
{
    while(1)
    {
        printf("3. FunSendPhoto Running...tid = %ld\n", pthread_self() );
        sleep(1);
    }
}

void *FunHandle( void *arg )
{
    while(1)
    {
        printf("4. FunHandle    Running...tid = %ld\n", pthread_self() );
        sleep(1);
    }
}


int main(int argc, char const *argv[])
{
    pthread_t tidFunTakePhoto;
    pthread_t tidFunSendPhoto;
    pthread_t tidFunHandle;

    pthread_create(&tidFunTakePhoto, NULL, FunTakePhoto, NULL);
    pthread_create(&tidFunSendPhoto, NULL, FunSendPhoto, NULL);
    pthread_create(&tidFunHandle   , NULL, FunHandle, NULL);

    while(1)
    {
        printf("1. main thread  Running...tid = %ld\n", pthread_self() );
        sleep(1);
    }
    

    return 0;
}

/*
创建多个线程， 并发运行
*/